package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 账号白名单
 * </p>
 * @author hua
 * @since 2024-12-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_user_white")
@NoArgsConstructor
public class UserWhiteDo extends Model<UserWhiteDo> {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 账号可见 客户id， 可见仓库id
     */
    @TableField("third_id")
    private Long thirdId;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;

    /**
     * company 账号可见 客户id  storage_wms wms可见仓库  storage_omp omp可见仓库
     */
    @TableField("type")
    private String type;

    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @TableField("create_time")
    private Date createTime;

    @TableField("create_by")
    private Long createBy;

    @TableField("delete_time")
    private Date deleteTime;

    @TableField("delete_by")
    private Long deleteBy;

    public UserWhiteDo(Long thirdId, Long userId, String type, Long createBy) {
        this.thirdId = thirdId;
        this.userId = userId;
        this.type = type;
        this.createBy = createBy;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
